package com.appkubes.fintech.admin.application.risk.rule.controller;

import com.appkubes.fintech.common.response.Response;
import com.appkubes.fintech.admin.application.risk.rule.entity.dto.RiskResultDTO;
import com.appkubes.fintech.admin.application.risk.rule.service.RiskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Rongjie
 * @Date: 2020/3/15
 * @Description:
 */
@Api(tags = "风控规则模块")
@RestController
@RequestMapping("/risk/control")
public class RiskController {
    @Resource
    RiskService riskService;

    //获取用户的风控结果
    @GetMapping("/getResult/{userKey}")
    @ApiOperation("获取风控结果")
    public Response getRiskResult(@PathVariable("userKey") String userKey) {
        List<RiskResultDTO> result = riskService.getResult(userKey);
        return Response.success(result);
    }
}
